﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using AssetManageSystem.Model.AssetManage;
using AssetManageSystem.Model.OrgManage;


namespace AssetManageSystem.ViewModel.AssetManage.AssetAllocationVMs
{
    public partial class AssetAllocationSearcher : BaseSearcher
    {
        [Display(Name = "单据编号")]
        public String DocNumber { get; set; }
        public List<ComboSelectListItem> AllOldUsers { get; set; }
        [Display(Name = "原使用人")]
        public Guid? OldUserId { get; set; }
        public List<ComboSelectListItem> AllOldDeps { get; set; }
        [Display(Name = "原使用部门")]
        public Guid? OldDepId { get; set; }
        public List<ComboSelectListItem> AllNewUsers { get; set; }
        [Display(Name = "现使用人")]
        public Guid? NewUserId { get; set; }
        public List<ComboSelectListItem> AllNewDeps { get; set; }
        [Display(Name = "现使用部门")]
        public Guid? NewDepId { get; set; }
        public Guid? AssetId { get; set; }
        //public List<ComboSelectListItem> AllAssetIds { get; set; }

        protected override void InitVM()
        {
            AllOldUsers = DC.Set<User>().GetSelectListItems(Wtm, y => y.UserName);
            AllOldDeps = DC.Set<Department>().GetSelectListItems(Wtm, y => y.DepName);
            AllNewUsers = DC.Set<User>().GetSelectListItems(Wtm, y => y.UserName);
            AllNewDeps = DC.Set<Department>().GetSelectListItems(Wtm, y => y.DepName);
            //AllAssetIds = DC.Set<AssetInfo>().GetSelectListItems(Wtm, y => y.AsName);
        }

    }
}
